Repository navigation
Show upload progress in stages: sent, ready to send, still to read - #67
Merged
Merged
Conversation
The upload line only moved when a whole 32 MiB part was stored, so on a slow connection it sat still for long stretches, then jumped, and a retried part was invisible. - A part upload reports the bytes of its body as the transport takes them, from zero on every attempt (the transport's own resend over a fresh connection included, through GetBody), and says when it will retry. - share.Params.Progress reports encrypted, sent and stored bytes and whether a part waits to retry. Stored and in-flight bytes change in one step, so a part never counts twice. - The line draws a bar in three parts that always add up to the bundle: sent (█), encrypted and ready to send (▓), still to read (░), then the amounts and the speed and time left, or that a part is tried again, or that the server has yet to confirm. A narrow terminal loses the speed first, then the bar. Downloads are unchanged. The network calls themselves are unchanged: three 32 MiB parts at once.
govulncheck fails on Go 1.27.3: GO-2026-6859, an HTTP/1 server crash through a MaxBytesReader header race in net/http, fixed in 1.27.4. The CLI is a client and only its tests run a server, but CI builds and releases with the version go.mod names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The same change as secretli/web#59, for the CLI. The upload line only moved when a whole 32 MiB part was stored, so on a slow connection it sat still for long stretches, then jumped, and a retried part was invisible.
What changes
api.Client.UploadParttakes an optional*api.PartProgress. ItsSenthook counts the request body as the transport takes it, from zero on every attempt, the transport's own resend over a fresh connection included (throughGetBody). ItsRetryinghook fires before the wait for another attempt.share.Params.Progressnow receivesshare.UploadProgress: total, encrypted, sent and stored bytes, plus whether a part waits to retry. They always nest. Stored and in-flight bytes change in one step, so a finished part never counts twice; the new nesting check in the share test caught exactly that.The network calls themselves are unchanged: three 32 MiB parts at once.
Checked
make testagainst a real server, andmake lint(0 issues). New tests cover the bar's cells, the line at full and narrow widths and during a retry, the rate starting over when the count goes back, part uploads counting from zero on a retry, and progress that nests and ends at the total.secretli shareof 200 MB (two files) against the local stack, in a pseudo-terminal, through a proxy throttling the upload: the line moved smoothly from 0% to "waiting for the server to confirm…" and printed the link.Reaches users with the next release tag.